package com.ohs.utils;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfigQRCode {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id ="2021000117683857";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key ="MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCwAD4fq3f+cSaxjIvZ3k6WsVpScXdC4RoxdgnxbMNu1WL+4t/0lgmoN+KjCc2Ip3y7SNnVsSFoC4H4Dr75Jp+uISD/eYGh3Qt5zIVHgL6ORsY8N70ZL+QxhoM/3h3eamdhMRdrKZ/Av2E6rFmrYaBZ2DYdaPS2pxEfihcpOFC0ZA0pwakW9USiYna2ItOIRum62XzXFfF2QEZUkNaeAOvmaGPL3+cCI9mZbCZqhggZtYZNQQPgkzwccko5zwu3zmj4n8rTanihFQp9BCCF+gUs9wVN0d0MSgKG8Co9Gc/vz2+5hiA8MKGmmioBvEDPaS0plOGbh9+skiyqiwOizAQ5AgMBAAECggEAMkwPdOuCwkNB5JGe0ed3HBeZEWB9za4Y1zO9ibIkc8MlpGPfzr0mC13VNfSyOTBsM/WQ00HooxxOyz4jk35XOeMb1Aa8Zi6OfgNVv2ZqjqxpMIJZVx5Zn1GqppDqhkpwOtVVtPlTPzkyJxtkENc4hRSF+oepD53VBedn0Q7X+YT4y5gBm84vokuhCyGmR+Q2xq6WMbnx7btczUO/NtDKOJH9BErFjamklthy3GMa5ixmvYpRxzfYrCY/2xNgIm1o0jNvBMkcWPhkm9xMmdpO1K8sZCC+Xpd8fcPMxi+BXNrO0/utzR/hvznG6OOutx8iTsaWRBI47X9Ay3eMImII0QKBgQDetW8RPHUx/Xa7vnICBMwO1odIY39MCZYthQfG5LSXAqx6su4T2SYDhObVk4wiw4YQbL8nJ+MilW/p8LsweKWVwPYfaWtbIoADfOGjZjyJMuZtXMjSWnCb6n6yjL4SMy6FMtSGd9z41MGO/aT4m0uZtFiuC/5eNM64TszusXdMPQKBgQDKT2gF2P/h3jBXoIsrWaWn9sTRcfzBcxkwN2xZyVhYiMCvwO9k2SZ7vMf+1IQp9o4y8UOjX8dMAXe8KWB3X2V4LQnr0VRn3Uuzac7pkaRoGkugmnTP7bvHnTDnNigpcNjoPxApy8tRBkkYuyWgN/jerX8p3FIl0stPXHZXLpBrrQKBgGTLXrpBT5VRbtRnzDeHrkck5tNnXKywRgzSAYQN7IHQDvn1U3UeOWssUkDlZ24wadOzNAxnrA/x7FXHwyCb6e1OCNaMoq77fU6WzZRjaBB8PffPH4C8t+yJA9CRjFC2Y16bc75sL1FbEUNDHs/5kQy+p8gV24kNg2W9HFkHbsPNAoGAcDFJBrUociG9vVqS0x+L9nGrBFuqR72EonCZ7dDy5WYxNUZRfCPQa55taqx//qV0hlu1nsxmwYeu1vI7RPfqVZLkhZo4rMDUUlLDJFRYUEME3bPKQ+Ua1cAedppZ+2FRaLpQRF14Cx7pOoXOf+OKaDLe6l/8Tm1vwjsMhZyVCqECgYBj0i+1LnwCxW8NYEA78ukSFvAwSaRfOVS9Njjn6td5t4GzaTN4+C9T20mrNnTy06IeC+76Ht+5GL/dymxL7xRlz7uHjotoqqmnE2xm6qklisBBpnDlaZz2wHufVZ3sO+qgrOZ9YE6ee+RBoq/QU0v2rMt4b9QAK7zYKXCGlZz1xA==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkyAesXIyaZX4lR/IIDAaaKic+Fn8hE5PDMxWUbYgjNq+sjVXlRLRTwhV8aqldMvda1WM3vkJxVv0ScA6Yi1M/FrxTljQZ7gLj67wBQ8/hlFJrrSfQHTnglh+KFfL8ppxfiFgTQWqz7Mh/fqgciW+a8F1hNZdIdw/tHlsRdvdOzdlfi1o5SRah80KSy2kkQb6BbyBtDyzO8bMIYAm1bAgtiOhwER+lvZ2geX/3JGZjAbFgco1X+bc836JDgC0CS8x2RZ5G/gSdbUtPkWpoUT1MSRjeTYvoxwAPYD7V+5F5aUWI3clt121mWz/XJsxO907BrEOLMWK5oQQ6J94FCyVfQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    //这里地址为，支付成功之后跳转的地址，异步地址
    public static String notify_url = "http://id7zw8.natappfree.cc/furniture/";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    //这里地址为，支付成功之后跳转的地址，同步
    public static String return_url = "http://id7zw8.natappfree.cc/furniture/";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";

    //↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
